// To prevent tests from failing with SQLite, we need to turn database caching off
$wgCaches[CACHE_DB] = false;
-require_once( 'PHPUnit/TextUI/Command.php' );
+require_once( 'PHPUnit/Runner/Version.php' );
+if( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
+ # PHPUnit 3.5.0 introduced a nice autoloader based on class name
+ require_once( 'PHPUnit/Autoload.php' );
+} else {
+ # Keep the old pre PHPUnit 3.5.0 behaviour for compatibility
+ require_once( 'PHPUnit/TextUI/Command.php' );
+}
PHPUnit_TextUI_Command::main();
-